home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Documentation / Tech Notes & Articles / Recipes / Imaging & Layout / Making a Frame Visible < prev    next >
Encoding:
Text File  |  1995-07-10  |  2.5 KB  |  37 lines  |  [TEXT/ttxt]

  1. OpenDoc™ Recipes
  2.  
  3.  
  4. Making a Frame Visible
  5. By The OpenDoc Design Team
  6. 19 April, 1994
  7.  
  8.  
  9. © 1993-1995  Apple Computer, Inc. All Rights Reserved.
  10. Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
  11. Mac and OpenDoc are trademarks of Apple Computer, Inc.
  12.  
  13.  
  14. OpenDoc maintains a lot of information about what parts are visible in a window, so that it may display them and dispatch events to them properly. But OpenDoc knows very little about the embedding structure of a document, as that information is stored by parts in encapsulated internal representations. Therefore, containing parts must tell OpenDoc about embedded frames that are visible. The way to do this is to make a facet for each place a frame is visible within a containing part.
  15.  
  16. An embedded frame may become visible when the containing part has scrolled or moved it into view, it was just embedded, an obscuring piece of content was removed, etc. When this happens, the containing part must ensure that there is a facet to display the frame. If there is no facet already, it can make one by asking a facet of its display frame to create it. Note that the containing part must create a facet for each place the frame becomes visible, which means it must create a facet for each facet of the containing part’s display frame(s).
  17.  
  18. The following fragment makes a frame “embeddedFrame” visible within a display frame “frame” of a containing part. The clip shape of the new facet is set to be the same as the embeddedFrame’s frame shape, but your part should alter that shape to reflect actual clipping. The external transform of the new facet is set from the internal content information stored within the containing part; the function ProxyForFrame() returns the internal object the part uses to hold information about the embedded frame within its content model. The new facet is created in front of all its sibling facets, if any.
  19.  
  20. ODShape* clip = kODNULL;
  21. ODTransform* xform = kODNULL;
  22. ODFrameFacetIterator* facets = frame->CreateFacetIterator(ev);
  23. for (ODFacet* facet = facets->First(ev);
  24.     facets->IsNotComplete(ev);
  25.     facet = facets->Next(ev))
  26. {
  27.     clip = ODCopyAndRelease(ev, embeddedFrame->AcquireFrameShape(ev));
  28.     xform = ODCopyAndRelease(ev, ProxyForFrame(embeddedFrame)->transform);
  29.                 facet->CreateEmbeddedFacet(ev, embeddedFrame, clip, xform,
  30.         kODNULL, kODNULL,    // no special canvas or bias
  31.         kODNULL,             // sibling facet
  32.         kODFrameInFront);    // frontmost
  33.     clip->Release(ev);
  34.     xform->Release(ev);
  35. }
  36.  
  37.